//
//  OPEatListCell.m
//  OnePiece
//
//  Created by wsy on 15/10/28.
//  Copyright © 2015年 wsy. All rights reserved.
//

#import "OPEatListCell.h"
#import <UIImageView+WebCache.h>
@implementation OPEatListCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _picture = [[UIImageView alloc]initWithFrame:CGRectMake(10, 5, SCREEN_WIDTH-20, SCREEN_WIDTH*235/600-10)];
        [self.contentView addSubview:_picture];
        UILabel *titlebackground = [[UILabel alloc]initWithFrame:CGRectMake(10, SCREEN_WIDTH*235/600 - 30, SCREEN_WIDTH-20, 25)];
        titlebackground.backgroundColor = [UIColor colorWithWhite:0.000 alpha:0.094];
        [self.contentView addSubview:titlebackground];
        _title = [[UILabel alloc]initWithFrame:CGRectMake(20, SCREEN_WIDTH*235/600 - 30, SCREEN_WIDTH - 40, 30)];
        _title.textColor = [UIColor whiteColor];
        _title.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:17];
        [self.contentView addSubview:_title];
    }
    return  self;
}

-(void)setConfigureModel:(OPEatListModel *)configureModel
{
    [_picture sd_setImageWithURL:[NSURL URLWithString:configureModel.cover] placeholderImage:[UIImage imageNamed:@"beijingImg.jpg"]];
    _title.text = configureModel.name;

}



@end
